package main

import (
	"fmt"
)

func jisuanqi(i int) func(o string, x int) int {
	return func(o string, x int) int {
		if o == "+" {
			i += x
		} else if o == "-" {
			i -= x
		} else if o == "*" {
			i *= x
		} else if o == "/" {
			i /= x
		}
		return i
	}
}
func main() {
	jisuan := jisuanqi(2)
	fmt.Println(jisuan("*", 10))
	fmt.Println(jisuan("nil", 0))
}
